package com.gaohe;

import com.gaohe.mapper.UserMapper;
import com.gaohe.pojo.User;
import com.gaohe.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest(classes = Application.class)
public class MpTests2 {


    @Autowired
    private UserService service;
    //查询全部
    @Test
    public void listUsers(){
        System.out.println(service.list());
    }

    //增
    @Test
    public void save(){
        User user = new User(null,"刘海柱","123",18,"15512345678");
        boolean save = service.save(user);
        System.out.println("save = " + save);
        System.out.println(user);
    }
    //删
    @Test
    public void deleteById(){

    }
    //查
    @Test
    public void getById(){

    }
    //改
    @Test
    public void modifyById(){
        User user = new User();
        user.setId(1l);
        user.setAge(222);

    }
}
